- return unless ProtectedBranch.branch_requires_code_owner_approval?(@project, merge_request.target_branch)
- code_owner_rules = merge_request.code_owner_rules_with_users
- return unless code_owner_rules.any?

.prepend-top-20
  %strong= _('Code owner approval is required')
  %p
    = _('At least one approval from a code owner is required to change files matching the respective CODEOWNER rules.')
    = link_to(_('Read more'), help_page_path('user/project/protected_branches.md', anchor: 'require-code-owner-approval-on-a-protected-branch'))

  .border-bottom
    %table.table.m-0
      %thead.thead-white.text-nowrap
        %tr.d-none.d-sm-table-row
          %th.w-25= s_('CodeOwner|Pattern')
          %th= _('Members')
      %tbody{ data: { qa_selector: "approver_list_content" } }
        - code_owner_rules.each do |code_owner_approval_rule|
          %tr{ data: { qa_selector: "approver_content" } }
            %td
              - if code_owner_approval_rule.section != Gitlab::CodeOwners::Section::DEFAULT
                %span.text-muted.small.d-block= code_owner_approval_rule.section
              %span.monospace= code_owner_approval_rule.name
            %td.d-none.d-sm-table-cell
              - code_owner_approval_rule.approvers.each do |approver|
                = user_avatar(user: approver)
